/**
 * 
 */
package w3;

/**
 * @Title: Commission </p>
 * @Package 
 * @Description: 
 * @author Administrator </p>
 * @version 1.0
 */
public class Commission {
	
	
	
	public static String classify(int[][] a) {		
		 int lp=45;
		 int sp=30;
		 int bp=25;
		 int lock=0,stock=0,barrel=0,total=0;
		 double commission;
		int i=0;
		while(a[i][0]!=-1) {
			lock+=a[i][0];
			stock+=a[i][1];
			barrel+=a[i][2];
			i++;
			
		}
		if (lock<1||lock>70||stock<1||stock>80||barrel<1||barrel>90) {
			
			String string="wrong";

			return string;
		}
		total=lock*lp+stock*sp+barrel*bp+total;
	
		if (total>1800) {
			commission=(total-1800)*0.2+220;
			
		}else if (total>1000) {
			commission=(total-1000)*0.15+100;
	
			
		}
		else {
			commission=total*0.1;
		}
		String str=total+" "+commission;
		return str;
	}
	
	

}
